package dao;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.text.DateFormatter;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


/**
 *
 * @author JeM
 */
public class UtilGeral {

    public static Date converteDataViewParaBanco(String stringData) {
        DateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
        try {
            return formatter.parse(stringData);
        } catch (ParseException ex) {
            throw new RuntimeException(ex);
        }
    }
    
    public static String converteDataBancoParaView(Date data) {
        DateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
       
            return formatter.format(data);
    }
     
}
